package seph;

import net.minecraft.src.GuiButton;
import net.minecraft.src.GuiScreen;
import net.minecraft.src.GuiSmallButton;

public class AchievementOptionsSettings extends GuiScreen {
	
	public AchievementOptionsSettings() {}
	
	private GuiSmallButton popups;
	
	private String title = "Achievement Options";
	
	public void initGui()
	{
		this.controlList.clear();
		//Done button
		this.controlList.add(new GuiSmallButton(0, this.width / 2 + 20, this.height / 2 - 20, 80, 20, "Done"));
		
		//Popups button
		this.controlList.add(popups = new GuiSmallButton(1, this.width / 2 - 120, this.height / 2 - 50, 100, 20, "Popups " + (AchievementOptions.enablePopups == true ? "Enable" : "Disabled")));
		
		//hotkey button
		this.controlList.add(popups = new GuiSmallButton(2, this.width / 2 - 120, this.height / 2 - 20, 100, 20, "Hotkey " + (AchievementOptions.enableHotkey == true ? "Enable" : "Disabled")));
		
		//advanced options
		this.controlList.add(popups = new GuiSmallButton(3, this.width / 2, this.height / 2 - 50, 100, 20, "Advanced " + (AchievementOptions.advancedOptions == true ? "Enable" : "Disabled")));
	}
	
	public void drawScreen(int par1, int par2, float par3)
	{
		super.drawDefaultBackground();
		this.fontRenderer.drawString(this.title, this.width / 2 - (this.fontRenderer.getStringWidth(this.title) / 2), this.height / 2 - 80, 0xFFFFFF);
		super.drawScreen(par1, par2, par3);
	}
	
	protected void actionPerformed(GuiButton button)
	{
		//Exit
		if (button.id == 0)
		{
			this.mc.displayGuiScreen((GuiScreen)null);
			this.mc.setIngameFocus();
			AchievementOptions.saveSettings();
		}
		
		//change Popups
		if (button.id == 1)
		{
			AchievementOptions.enablePopups = !AchievementOptions.enablePopups;
			button.displayString = "Popups " + (AchievementOptions.enablePopups == true ? "Enable" : "Disabled");
		}
		
		if (button.id == 2)
		{
			AchievementOptions.enableHotkey = !AchievementOptions.enableHotkey;
			button.displayString = "Hotkey " + (AchievementOptions.enableHotkey == true ? "Enable" : "Disabled");
		}
	}
	
}
